<ul class="maintabmenu multipletabmenu">
    <li><a href="<?php echo base_url();?>administrator/projects">Tất cả dự án</a></li>
    <li><a href="<?php echo base_url();?>administrator/projects/create">Thêm mới dự án</a></li>
    <li class="current"><a href="<?php echo base_url();?>administrator/pcategories"">Danh mục dự án</a></li>
</ul>
<div class="content">

    <div class="edit-left">
        <?php if (isset($category) && $category!=null) { ?>        
            <form action="" method="post" accept-charset="utf-8" id="category-form" class="stdform">
                <?php
                if ($this->session->flashdata('update_pcat_success')) {
                    ?>
                    <div class="notification msgsuccess">
                        <a class="close"></a>
                        <p>Cập nhật danh mục thành công.</p>
                    </div>
                <?php } else if ($this->session->flashdata('update_pcat_error')) { ?>
                    <div class="notification msgerror">
                        <a class="close"></a>
                        <p>Danh mục chưa được cập nhật.</p>
                    </div>
                <?php } ?>
                <input type="hidden" name="id" value="<?php echo $category->id; ?>"/>
                <p><label>Tên danh mục:</label></p>
                <p><span class="field"><input name="name" value="<?php echo $category->name; ?>" id="txttitle" class="longinput" type="text"></span></p>            
                <br>
                <p><label>Mô tả:</label></p>                            
                <p><span class="field"><textarea name="description"><?php echo $category->description; ?></textarea></span></p>
                <br>            
                <p class="stdformbutton">
                    <input name="submit" value="Cập nhật" class="submit radius2" type="submit">                                
                    <input value="Hủy" class="reset radius2" type="reset">
                </p>                            
            </form>    
        <?php } else { ?>
            <div class="notification msgalert">
                <a class="close"></a>
                <p>Không tồn tại danh mục này.</p>
            </div>
        <?php } ?>
    </div>
    <div class="list-right">
        <div class="contenttitle radiusbottom0">
            <h2 class="table"><span>Danh mục tin tức</span></h2>
        </div><!--contenttitle-->
        <div class="tableoptions">
            <button class="deletebutton radius3" name="delete_term" value="<?php echo base_url(); ?>administrator/categories/delete" title="table2">Delete Selected</button> &nbsp;                           
        </div><!--tableoptions-->	
        <table id="table2" class="stdtable stdtablecb" border="0" cellpadding="0" cellspacing="0">
            <colgroup>
                <col class="con0">
                <col class="con1">
                <col class="con0">
                <col class="con1">

            </colgroup>
            <thead>
                <tr>
                    <th class="head0" width="10"><input class="checkall" type="checkbox"></th>
                    <th class="head1">Tên danh mục</th>
                    <th class="head0">Mô tả</th>
                    <th class="head0" width="60">&nbsp;</th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <th class="head0"><input class="checkall" type="checkbox"></th>
                    <th class="head1">Tên danh mục</th>
                    <th class="head0">Mô tả</th>
                    <th class="head0">&nbsp;</th>
                </tr>
            </tfoot>
            <tbody>
                <?php foreach ($categories as $cat) { ?>
                    <tr>
                        <td class="center"><input value="<?php echo $cat->id ?>" type="checkbox"></td>
                        <td><?php echo $cat->name ?></td>
                        <td><?php echo $cat->description ?></td>
                        <td class="center">
                            <a class="edit" title="Sửa" href="<?php echo base_url(); ?>administrator/pcategories/edit/<?php echo $cat->id ?>">Sửa</a> &nbsp; 
                            <a class="delete" id="<?php echo $cat->id?>" name="delete" title="Xóa danh mục" href="<?php echo base_url(); ?>administrator/pcategories/delete">Xóa</a>
                        </td>
                    </tr>                
                <?php } ?>
            </tbody>
        </table>
    </div>                                  

</div>